<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>财务健康评估</title>
    <style>
        /* 通用样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background-color: #f4f7fc;
            color: #333;
            line-height: 1.6; /* 增加行高，提升可读性 */
        }

        .container {
            width: 80%;
            margin: 0 auto;
            padding-top: 20px; /* 增加顶部间距 */
        }

        header {
            background-color: #021313;
            color: white;
            padding: 30px 0; /* 增加上下内边距 */
        }

        header h1 {
            text-align: center;
            font-size: 2.5em;
        }

        header nav ul {
            display: flex;
            justify-content: center;
            gap: 30px; /* 增加按钮间距 */
            list-style: none;
        }

        header nav ul li {
            display: inline-block;
        }

        header nav ul li a {
            color: white;
            text-decoration: none;
            font-size: 1.2em;
            padding: 8px 12px; /* 增加按钮内边距 */
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }

        header nav ul li a:hover {
            background-color: #1c276c; /* 鼠标悬停时按钮变色 */
            text-decoration: none;
        }

        h2 {
            margin-bottom: 20px;
            color: #283593;
            font-size: 1.8em;
            font-weight: bold;
        }

        .section {
            margin-bottom: 40px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 30px;
            background-color: white;
        }

        table th, table td {
            padding: 15px;
            text-align: center;
            border: 1px solid #ddd;
        }

        table th {
            background-color: #283593;
            color: white;
            font-weight: bold;
        }

        table tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        table tr:hover {
            background-color: #f1f1f1;
        }

        /* 侧边栏样式 */
        .sidebar {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            width: 250px;
            position: fixed;
            top: 20px;
            left: 20px;
            height: calc(100vh - 40px);
            overflow-y: auto;
        }

        .sidebar h2 {
            font-size: 1.6em;
            color: #283593;
            margin-bottom: 20px;
            text-align: center;
            font-weight: bold;
        }

        .sidebar .btn {
            display: block;
            background-color: #283593;
            color: white;
            text-align: center;
            padding: 12px;
            margin-bottom: 10px;
            border-radius: 5px;
            text-decoration: none;
            font-size: 1.1em;
            transition: background-color 0.3s ease;
        }

        .sidebar .btn:hover {
            background-color: #1c276c;
        }

        .sidebar .btn:focus {
            outline: none;
        }

        /* 主要内容区域 */
        main {
            margin-left: 270px; /* 留出侧边栏空间 */
            padding: 20px;
            min-height: 100vh;
        }

        footer {
            background-color: #021313;
            color: white;
            padding: 10px 0;
            text-align: center;
        }

        footer p {
            font-size: 1em;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .sidebar {
                width: 100%;
                position: relative;
                top: auto;
                left: auto;
                height: auto;
            }

            main {
                margin-left: 0;
            }

            header nav ul {
                flex-direction: column;
                gap: 15px;
            }
        }

    </style>
</head>
<body>
<header>
    <h1>企业财务健康评估</h1>
    <nav>
        <ul>
            <li><a href="#latest-statements">最新财务报表</a></li>
            <li><a href="#health-index">财务健康指数</a></li>
        </ul>
    </nav>
</header>

<main>
    <!-- 左侧栏 -->
    <aside class="sidebar">
        <h2>导航: 财务数据分析</h2>

        <!-- 各种功能的链接 -->
        <div><a href="/visualization/" class="btn btn-primary">财务数据可视化</a></div>
        <div><a href="/financials/" class="btn btn-secondary">财务报表</a></div>
        <div><a href="/debt_risk_analysis/" class="btn btn-warning">风险分析</a></div>
        <!-- 模板中使用生成的 URL  使用这个的时候
app_name = 'finance'  # 设置命名空间为 'finance'-->
        <div><a href="{% url 'finance:financial_data_analysis' statement_id=1 %} " class="btn btn-warning" >查看财务数据分析</a></div>
        <div><a href="/income_statement/" class="btn btn-dark">损益表分析</a></div>
        <div><a href="/balance_sheet/" class="btn btn-light">资产负债表</a></div>
        <div><a href="/forecast_analysis/" class="btn btn-primary">财务预测分析</a></div>
        <div><a href="/add/" class="btn btn-danger">注册</a></div>
        <div><a href="/statement/" class="btn btn-primary">财务报表列表</a></div>
        <div><a href="http://localhost:8000/health_index/" class="btn btn-primary">财务健康指数</a></div>
    </aside>
    <!-- 右侧内容区域 -->
    <section id="latest-statements">
        <h2>最新财务报表</h2>
        <table>
            <thead>
            <tr>
                <th>年度</th>
                <th>总资产</th>
                <th>负债</th>
                <th>净利润</th>
            </tr>
            </thead>
            <tbody>
            <!-- 默认数据 -->
            <tr>
                <td>2024</td>
                <td>500,000,000</td>
                <td>200,000,000</td>
                <td>50,000,000</td>
            </tr>
            <tr>
                <td>2023</td>
                <td>450,000,000</td>
                <td>180,000,000</td>
                <td>45,000,000</td>
            </tr>
            <tr>
                <td>2022</td>
                <td>400,000,000</td>
                <td>150,000,000</td>
                <td>40,000,000</td>
            </tr>
            <tr>
                <td>2021</td>
                <td>380,000,000</td>
                <td>140,000,000</td>
                <td>35,000,000</td>
            </tr>
            <tr>
                <td>2020</td>
                <td>350,000,000</td>
                <td>130,000,000</td>
                <td>30,000,000</td>
            </tr>
            </tbody>
        </table>
    </section>

    <section id="health-index">
        <h2>财务健康指数</h2>
        <table>
            <thead>
            <tr>
                <th>年度</th>
                <th>盈利能力</th>
                <th>偿债能力</th>
                <th>运营效率</th>
                <th>总体健康指数</th>
            </tr>
            </thead>
            <tbody>
            <!-- 默认数据 -->
            <tr>
                <td>2024</td>
                <td>85</td>
                <td>90</td>
                <td>88</td>
                <td>87.6</td>
            </tr>
            <tr>
                <td>2023</td>
                <td>80</td>
                <td>85</td>
                <td>83</td>
                <td>82.6</td>
            </tr>
            <tr>
                <td>2022</td>
                <td>78</td>
                <td>82</td>
                <td>80</td>
                <td>80.0</td>
            </tr>
            <tr>
                <td>2021</td>
                <td>75</td>
                <td>78</td>
                <td>76</td>
                <td>76.3</td>
            </tr>
            <tr>
                <td>2020</td>
                <td>70</td>
                <td>75</td>
                <td>72</td>
                <td>72.3</td>
            </tr>
            </tbody>
        </table>
    </section>
</main>

<footer>
    <p>&copy; 2024 企业财务健康评估系统</p>
</footer>
</body>
</html>
